<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>Title</title>
</head>
<style type="text/css">
  .box {
    width: 100%;
  }
  .inner:nth-child(1){
    background-color:  green ;
  }
  .inner:nth-child(2){
    background-color:  gold ;
  }
  .inner:nth-child(3){
    background-color:  green ;
  }
  .inner:nth-child(4){
    background-color:  gold ;
  }
  @media screen and (max-width: 320px) {
    /*最大为320px*/
    .inner {
      width: 25%;
      height: 100px;
      float:left;
      background-color: blue;
    }
  }

  @media screen and (min-width: 321px) {
    .inner {
      width: 100px;
      height: 100px;
      background-color: green;
    }
  }
</style>
<body>
<div class="box">
  <div class="inner">

  </div>
  <div class="inner">

  </div>
  <div class="inner">

  </div>
  <div class="inner">

  </div>
  <div class="inner">

  </div>
</div>
</body>
</html>
